package com.nanhang.controller;

import com.nanhang.common.util.R;
import com.nanhang.service.DepartmentsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/departments")
public class DepartmentsController {
    @Autowired
    private DepartmentsService departmentsService;
    @GetMapping("/list")
    public R list(){
        return R.ok().data("list",departmentsService.list());
    }

}
